package PolymorphicHomeworkTest2;

public class HourlyEmployee extends Employee{
    private double hourSalary;
    private double hourMonth;

    public HourlyEmployee() {
    }

    public HourlyEmployee(String name,int month,double hourSalary, double hourMonth) {
        super(name,month);
        this.hourSalary = hourSalary;
        this.hourMonth = hourMonth;
    }

    public double getHourSalary() {
        return hourSalary;
    }

    public void setHourSalary(double hourSalary) {
        this.hourSalary = hourSalary;
    }

    public double getHourMonth() {
        return hourMonth;
    }

    public void setHourMonth(double hourMonth) {
        this.hourMonth = hourMonth;
    }

    public double getSalary(int month){
        double sumSalary = 0;
        if(this.hourMonth <= 160){
            sumSalary = this.hourMonth * this.hourSalary;
        }else{
            sumSalary = (this.hourMonth - 160) * this.hourSalary * 1.5 + (this.hourSalary * 160);
        }
        if(super.getMonth() == month){
            sumSalary += 100;
        }
        return sumSalary;
    }

}
